import axios from 'axios';
const service = axios.create({
  // baseURL: 'http://192.168.0.110:9094/jwt',
  baseURL: 'http://192.168.0.82:9094/jwt',
  timeout: 10000,
  headers: {
    'Content-Type': 'application/json;'
  }
});

// request拦截器
service.interceptors.request.use(
  config => {
    // 请求之前可以做处理
    // console.log('请求拦截: ', JSON.stringify(config, 0, 4));
    console.log('请求拦截: ', JSON.stringify(config, 0, 4));
    return config;
  },
  error => {
    Promise.reject(error);
  }
);

// respone拦截器
service.interceptors.response.use(
  response => {
    return response.data;
  },
  error => {
    return Promise.reject(error);
  }
);

export default service;
